package main

import (
	"net/http"
	"flag"
	"hg.cloud9lib.net/cloud9lib.hg/rest"
)

func main () {

	port := flag.String("port", "80", "port to listen on")
	path := flag.String("path", "./", "directory to serve files from")

	flag.Parse()

	if *port == "" {
		flag.Usage()
		return
	}

	http.Handle("/", rest.Log(http.FileServer(http.Dir(*path))))

	err := http.ListenAndServe(":" + *port, nil)
	
	panic (err)
}
